package net.xyz.dropitem;

import java.util.List;

import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.event.HandlerList;
import org.bukkit.plugin.java.JavaPlugin;


public class DropItem extends JavaPlugin {
	private static DropItem instance;
	private static YamlConfiguration cg;
	
	@Override
	public void onDisable() {
		HandlerList.unregisterAll();
	}
	@Override
	public void onEnable() {
		instance = this;
		Config();
		getServer().getPluginManager().registerEvents(new Listening(), this);
		getCommand("dtm").setExecutor(new PlayerCommand());
	}
	public static DropItem getInstance(){
		return instance;
	}
	public static FileConfiguration getCg(){
		return cg;
	}
	public static void Config(){
		Config.createConfig();
		DropItem.cg=Config.getConfig();
		Listening.setWorld(null);
		List<String> str=DropItem.getCg().getStringList("BreakWorld");
		Listening.setWorld(str);
		DropUtil.setTreeTypeMaterials(null);
		DropUtil.setMineTypeMaterials(null);
		DropUtil.setTreeTypeMaterials("载入");
		DropUtil.setMineTypeMaterials("载入");
	}
}
